# the minimum version of CMake.
cmake_minimum_required(VERSION 3.4.1)
project(MyNote)
set(CMAKE_CXX_STANDARD 20)  # C++20
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
set(PYTORCH_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/pytorch)
set(UTF8PROC_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8proc)

# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")

# include_directories(${TORCH_INCLUDE_DIRS})
include_directories(${PYTORCH_INCLUDE_PATH}/include
                    ${PYTORCH_INCLUDE_PATH}/include/torch/csrc/api/include
                    ${UTF8PROC_INCLUDE_PATH})

add_subdirectory(third_party/json EXCLUDE_FROM_ALL)
add_subdirectory(src)
include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)
add_library(entry SHARED BartInference.cpp)
target_link_libraries(entry PUBLIC libace_napi.z.so model hilog_ndk.z)